package com.foreknow.demo6;

/**
 * 方法的参数和返回值类型为自定义类类型在实际项目中的使用
 */
public class ManagerApplication {


    //添加员工   insert into employee values(?,?,?,?)
    public boolean addEmployee(Employee employee) {
        System.out.println(employee.getCard());
        System.out.println(employee.getName());
        System.out.println(employee.getDept());
        System.out.println(employee.getSalary());
        return true;
    }

    //登录 select * from employee where username=? and passoword=?
    public Employee getQuery(String username,String password) {
        Employee e = new Employee();
        e.setCard(1002);
        e.setName(username);
        e.setDept("program");
        e.setSalary(45.67);
        return e;
    }

    public static void main(String[] args) {
        ManagerApplication application = new ManagerApplication();
        Employee emp = new Employee();
        //可以通过set方法给对象的属性设置值
        emp.setCard(1001);
        emp.setName("fender");
        emp.setDept("market");
        emp.setSalary(3456.70);
        application.addEmployee(emp);

        System.out.println("-------------------------------------------------------");

        Employee e = application.getQuery("gibson","123456");
        System.out.println(e.getName());

    }
}
